package efg.tasks;

import efg.Train;
import interfacesFerrovia.ControleFerrovia;

public class BreakTrainTask extends SchedulableTask {

	private Train train;
	private Float finalSpeed;
	private Boolean isUrgent;

	public BreakTrainTask(Integer time, Train train, Float velocidade,
			Boolean isUrgent) {
		super(time);
		assert (train != null && velocidade != null && isUrgent != null);
		this.train = train;
		this.finalSpeed = velocidade;
		this.isUrgent = isUrgent;
	}

	@Override
	public void execute(ControleFerrovia railwayControl) {
		railwayControl.frearComposicao(train.getId(), finalSpeed, isUrgent);
	}

	public Train getTrain() {
		return train;
	}

	public Float getFinalSpeed() {
		return finalSpeed;
	}

	public Boolean getIsUrgent() {
		return isUrgent;
	}

}
